avatar {
  border-radius: $circular-radius;
  font-weight: bold;

  // The list of colors to generate avatars.
  // Each avatar color is represented by a font color, a gradient start color and a gradient stop color.
  // There are 8 different colors for avtars in the list if you change the number of them you
  // need to update the NUMBER_OF_COLORS in src/adw-avatar.c.
  // The 2D list has this form: ((font-color, gradient-top-color, gradient-bottom-color)).
  $avatarcolorlist: (
   (#cfe1f5, #83b6ec, #337fdc), // blue
   (#caeaf2, #7ad9f1, #0f9ac8), // cyan
   (#cef8d8, #8de6b1, #29ae74), // green
   (#e6f9d7, #b5e98a, #6ab85b), // lime
   (#f9f4e1, #f8e359, #d29d09), // yellow
   (#ffead1, #ffcb62, #d68400), // gold
   (#ffe5c5, #ffa95a, #ed5b00), // orange
   (#f8d2ce, #f78773, #e62d42), // raspberry
   (#fac7de, #e973ab, #e33b6a), // magenta
   (#e7c2e8, #cb78d4, #9945b5), // purple
   (#d5d2f5, #9e91e8, #7a59ca), // violet
   (#f2eade, #e3cf9c, #b08952), // beige
   (#e5d6ca, #be916d, #785336), // brown
   (#d8d7d3, #c0bfbc, #6e6d71), // gray
  );

  @for $i from 1 through length($avatarcolorlist) {
    &.color#{$i} {
      $avatarcolor: nth($avatarcolorlist, $i);
      background-image: linear-gradient(nth($avatarcolor, 2), nth($avatarcolor, 3));
      color: nth($avatarcolor, 1);
    }
  }

  &.contrasted { color: white; }

  &.image { background: none; }
}

$opaque_button_default_bg: mix($base, $text, 85%);

button {
  @at-root %opaque-button {
    box-shadow: none;
    transition: $transition,
                box-shadow $ripple-fade-in-duration $ease-out;

    .osd &:focus:focus-visible {
      outline: none;
    }

    &:hover {
      background-image: image(gtkalpha(currentColor, .1));
    }

    &.keyboard-activating,
    &:active {
      background-image: image(transparentize(black, .8));
    }

    &:checked {
      background-image: image(transparentize(black, .85));

      &:hover {
        background-image: image(transparentize(black, .95));
      }

      &.keyboard-activating,
      &:active {
        background-image: image(transparentize(black, .7));
      }
    }
  }

  &.opaque {
    @extend %opaque-button;

    background-color: $opaque_button_default_bg;
    color: $text;
  }

  &.destructive-action {
    @extend %opaque-button;

    color: on($destructive);

    &, &:checked {
      background-color: $destructive;
    }
  }

  &.suggested-action {
    @extend %opaque-button;

    color: on($suggested);

    &, &:checked {
      background-color: $suggested;
    }
  }

  // hide separators
  &.font {
    separator { background-color: transparent; }
    > box { border-spacing: $space-size; }
    > box > box > label { font-weight: bold; }
  }

  @at-root %pill-button,
  &.pill {
    padding: 10px 32px;
    border-radius: $circular-radius;
  }

  &.card {
    background-clip: padding-box;
    font-weight: inherit;
    box-shadow: none;
    transition: $transition;

    &:hover {
      @include button(hover);
    }

    &.keyboard-activating,
    &:active {
      @include button(active);
    }

    &:checked {
      @include button(active);
    }

    &:drop(active) {
      color: $drop_target_color;
      box-shadow: inset 0 0 0 1px $drop_target_color;
    }
  }
}

menubutton {
  &.osd {
    background: none;
    color: inherit;
  }

  &.circular > button { @extend %circular-button; }
  &.flat > button { @extend %button-flat; }
  &.pill > button { @extend %pill-button; }

  &.suggested-action {
    background-color: $suggested;
    color: on($suggested);
  }

  &.destructive-action {
    background-color: $destructive;
    color: on($destructive);
  }

  &.opaque {
    background-color: $opaque_button_default_bg;
    color: $text;
  }

  &.suggested-action,
  &.destructive-action,
  &.opaque {
    border-radius: $corner-radius;

    &.circular, &.pill {
      border-radius: $circular-radius;
    }

    > button {
      @extend %opaque-button;

      &, &:checked {
        background-color: transparent;
        color: inherit;
      }
    }
  }

  &.image-button > button {
    min-width: 24px;
    padding-left: $space-size;
    padding-right: $space-size;
  }

  arrow {
    min-height: 16px;
    min-width: 16px;
    &.none {
      -gtk-icon-source: -gtk-icontheme('open-menu-symbolic');
    }
    &.down {
      -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
    }
    &.up {
      -gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
    }
    &.left {
      -gtk-icon-source: -gtk-icontheme('pan-start-symbolic');
    }
    &.right {
      -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
    }
  }
}

splitbutton {
  border-radius: $corner-radius;

  &:disabled {
    filter: none;
    opacity: 1;
  }

  &, & > separator {
    transition: $transition;
    transition-property: background;
  }

  > separator {
    margin-top: $space-size;
    margin-bottom: $space-size;
    background: none;
  }

  > menubutton > button {
    padding-left: $space-size;
    padding-right: $space-size;
  }

  // Since the inner button doesn't have any style classes on it,
  // we have to add them manually
  &.image-button > button {
    min-height: 24px;
    min-width: 24px;
    padding: ($medium-size - 24px) / 2;
  }

  &.text-button.image-button > button,
  &.image-text-button > button {
    padding-left: $space-size * 1.5;
    padding-right: $space-size * 1.5;

    > box {
      border-spacing: $space-size;
    }
  }

  // Reimplementing linked so we don't blow up css
  > button:dir(ltr),
  > menubutton > button:dir(rtl) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: 0;
  }

  > button:dir(rtl),
  > menubutton > button:dir(ltr) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: 0;
  }

  @at-root %flat_split_button,
  &.flat {
    > separator {
      background: $divider;
    }

    &:hover,
    &:active,
    &:checked {
      background: gtkalpha(currentColor, 0.1);
      color: $text;

      > separator {
        background: none;
      }
    }

    &:focus-within:focus-visible > separator {
      background: none;
    }

    > button,
    > menubutton > button {
      @extend %button-flat;

      border-radius: $corner-radius;
    }
  }

  &.suggested-action {
    background-color: $suggested;
    color: on($suggested);
  }

  &.destructive-action {
    background-color: $destructive;
    color: on($destructive);
  }

  &.opaque {
    background-color: $opaque_button_default_bg;
    color: $text;
  }

  &.suggested-action,
  &.destructive-action,
  &.opaque {
    > button, > menubutton > button {
      @extend %opaque-button;

      &, &:checked {
        color: inherit;
        background-color: transparent;
      }
    }

    > menubutton > button {
      &:dir(ltr) { box-shadow: inset 1px 0 $divider; }
      &:dir(rtl) { box-shadow: inset -1px 0 $divider; }
    }
  }

  > menubutton > button > arrow.none {
    -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
  }
}

buttoncontent {
  border-spacing: $space-size;

  > label {
    font-weight: bold;

    &:dir(ltr) { padding-right: 2px; }
    &:dir(rtl) { padding-left: 2px; }
  }

  .arrow-button > box > &,
  splitbutton > button > & {
    > label {
      &:dir(ltr) { padding-right: 0; }
      &:dir(rtl) { padding-left: 0; }
    }
  }
}

//
// Toasts
//

toast {
  @extend %osd;
  margin: $space-size * 2;
  margin-bottom: 24px;
  border-radius: $circular-radius;
  border-spacing: $space-size;
  padding: $space-size;
  box-shadow: $shadow-z6, inset 0 1px highlight($base);
  color: $text-secondary;
  font-weight: normal;

  &:dir(ltr) { padding-left: $space-size * 2; }
  &:dir(rtl) { padding-right: $space-size * 2; }

  > widget {
    margin: 0 $space-size;
  }
}

//
// AdwStatusPage
//

statuspage {
  > scrolledwindow > viewport > box {
    margin: $space-size * 6 $space-size * 2;
    border-spacing: 36px;

    > clamp > box {
      border-spacing: $space-size * 2;

      > .icon {
        -gtk-icon-size: 128px;

        color: gtkalpha(currentColor, 0.45);

        &:disabled {
          opacity: 0.45;
        }

        &:not(:last-child) {
          margin-bottom: $space-size * 4;
        }
      }
    }
  }

  &.compact > scrolledwindow > viewport > box {
    margin: $space-size * 4 $space-size * 2;
    border-spacing: $space-size * 4;

    > clamp > box {
      > .icon {
        -gtk-icon-size: 96px;

        &:not(:last-child) {
          margin-bottom: $space-size * 2;
        }
      }

      > .title {
        font-size: 18pt;
      }
    }
  }
}

// Cards
.card, %card {
  border-radius: $corner-radius;
  box-shadow: none;
  border: 1px solid $divider;
  background-clip: padding-box;
  background-color: $base;
  color: $text-secondary;
}

// preferences
preferencespage > scrolledwindow > viewport > clamp > box {
  margin: $space-size * 4 $space-size * 2;
  border-spacing: $space-size * 4;
}

preferencesgroup > box {
  &, .labels {
    border-spacing: $space-size;
  }

  > box.header:not(.single-line) {
    margin-bottom: $space-size;
  }

  > box.single-line {
    min-height: $medium-size;
  }

  button.background-preview-button.toggle {
    padding: 0;
    background: none;
    box-shadow: none;
    outline-color: transparent;
    outline-width: 3px;
    outline-offset: $space-size / 2;
    outline-style: solid;

    &, > background-preview {
      border-radius: 6px;
    }

    &:hover {
      outline-color: $fill;
    }

    &:active {
      outline-color: $track;
    }

    &:checked {
      outline-color: $primary;
    }
  }
}

//
// AdwBanner
//

banner > revealer > widget {
  /* There are 2 more instances in _sidebars.css, keep in sync with that */
  background-color: gtkmix($primary, $base, 30%);
  color: $text;
  padding: $space-size;

  &:backdrop {
    background-color: gtkmix($primary, $base, 15%);

    > label, > button {
      filter: opacity(.5);
    }
  }
}

//
// viewswitcher
//

viewswitcher {
  border-spacing: $space-size / 2;
  min-height: 24px;

  &.narrow {
    margin-top: 0;
    margin-bottom: 0;
    min-height: 6px;
  }

  headerbar &.narrow {
    margin-top: -$space-size;
    margin-bottom: -$space-size;
  }

  &.wide {
    border-spacing: 0;
    border-radius: $circular-radius;
    background-color: $titlebar-fill;

    button.toggle:checked, button.toggle.flat:checked {
      background-color: $primary;
      color: on($primary);

      &:backdrop { color: on($primary, disabled); }

      indicatorbin.needs-attention > indicator {
        > label { color: $primary; }
        background-color: on($primary);
      }
    }
  }

  &.narrow button.toggle {
    border-radius: 0;
    border: none;
  }

  button.toggle {
    font-weight: bold;
    padding: 0;
    min-height: 0;

    > stack > box {
      &.narrow {
        font-size: 0.75rem;
        padding-top: $space-size;
        padding-bottom: $space-size;
        border-spacing: $space-size / 2;

        > stack > label {
          padding-left: $space-size + 2px;
          padding-right: $space-size + 2px;
        }

        > label {
          min-height: 18px;
          padding-left: 3px;
          padding-right: 3px;
          padding-bottom: 0;
        }
      }

      &.wide {
        padding: 0 $space-size * 2;
        border-spacing: $space-size;
      }
    }
  }
}

// AdwViewSwitcherBar
viewswitcherbar actionbar > revealer > box {
  padding: 0;
}

// AdwViewSwitcherTitle
headerbar viewswitchertitle {
  margin-top: -$space-size;
  margin-bottom: -$space-size;

  viewswitcher {
    margin-left: $space-size * 2;
    margin-right: $space-size * 2;

    &.narrow {
      margin-top: 0;
      margin-bottom: 0;
    }

    &.wide {
      margin-top: $space-size;
      margin-bottom: $space-size;
    }
  }

  windowtitle {
    margin-top: 0;
    margin-bottom: 0;
  }
}

// AdwIndicatorBin
indicatorbin {
  > indicator, > mask {
    min-width: $space-size;
    min-height: $space-size;
    border-radius: $circular-radius;
  }

  > indicator {
    margin: 1px;
    padding: 0;
    background: gtkalpha(currentColor, .4);

    > label {
      font-size: 0.6rem;
      font-weight: bold;
      padding: 2px 5px;
      color: white;
    }
  }

  > mask {
    padding: 1px;
    background: black;
  }

  &.needs-attention > indicator {
    background-color: $primary;

    > label { color: on($primary); }
  }
}

//
// tab-view
//

tabbar {
  .box {
    min-height: $menuitem-size;
    background-color: $background;
    color: $text-secondary;
    padding: 0;
    box-shadow: inset 0 -1px $solid-border;
    border-bottom: none;
  }

  tabbox {
    padding: 0;
    min-height: $menuitem-size;

    > tabboxchild {
      border-radius: 0;
      margin: 0;
      padding-top: 4px;
    }

    > separator {
      margin-top: $space-size * 1.5;
      margin-bottom: $space-size * 1.5;
      transition: opacity 150ms ease-in-out;

      &.hidden {
        opacity: 0;
      }
    }

    > revealer > indicator {
      min-width: 2px;
      border-radius: 2px;
      margin: $space-size * 1.5 $space-size;
      background: gtkalpha($primary, 0.5);
    }
  }

  tab {
    transition: none;
    border-radius: $corner-radius $corner-radius 0 0;
    border: 1px solid transparent;
    border-bottom-width: 0;
    color: $text-secondary;
    padding: $space-size $space-size * 2;

    &:hover:not(:selected):not(:active):not(:checked) {
      transition: none;
      background-color: $solid-border;
      box-shadow: none;
      color: $text;
      border-color: $solid-border;
      border-radius: $corner-radius $corner-radius 0 0;
    }

    &:selected, &:checked, &:active {
      transition: background-color 150ms ease-in-out;
      background-color: $base;
      box-shadow: none;
      color: $text;
      border-color: $solid-border;
      border-radius: $corner-radius $corner-radius 0 0;
    }
  }

  .start-action,
  .end-action {
    padding: 6px;
  }

  .start-action:dir(ltr),
  .end-action:dir(rtl) {
    padding-right: 0;
  }

  .start-action:dir(rtl),
  .end-action:dir(ltr) {
    padding-left: 0;
  }
}

tabview > stack { background-color: $base; }

dnd tab {
  background-color: $background;
  color: $text-secondary;
  box-shadow: none;
  margin: $space-size * 4;
}

tabbar,
dnd {
  tab {
    button.image-button {
      padding: 0;
      margin: 0;
      min-width: 20px;
      min-height: 20px;
      border-radius: $circular-radius;
      border: none;
      @extend %button-flat;
    }

    indicator {
      min-height: 2px;
      border-radius: 2px;
      background: gtkalpha($primary, 0.5);
    }
  }
}

tabview:drop(active),
tabbox:drop(active) {
  box-shadow: none;
}

// Transition shadows
flap,
leaflet,
navigation-view,
overlay-split-view {
  @include transition-shadows($frame);
}

toolbarview.undershoot-top scrolledwindow {
  @include undershoot(top);
}

toolbarview.undershoot-bottom scrolledwindow {
  @include undershoot(bottom);
}

navigation-view navigation-view-page .medium stack > button { // Nautilus properties
  margin-top: $space-size * 2;
}

// Sidebar
.unfolded stacksidebar.sidebar { border: none; }

$sidebar: if($variant == 'light' and $topbar == 'dark', $titlebar, $base-alt);
$sidebar-backdrop: if($variant == 'light' and $topbar == 'dark', $titlebar-backdrop, $background);

.sidebar-pane,
.content-pane .sidebar-pane,
.sidebar-pane .content-pane {
  background-color: $sidebar;
  color: on($sidebar);

  &:backdrop {
    background-color: $sidebar-backdrop;
    transition: background-color $duration $ease-out;
  }

  flap,
  leaflet,
  navigation-view,
  overlay-split-view {
    @include transition-shadows($frame);
  }

  banner > revealer > widget {
    background-color: gtkmix($primary, $sidebar, 30%);
    color: on($sidebar);

    &:backdrop {
      background-color: gtkmix($primary, $sidebar, 30%);
    }
  }

  &:dir(ltr), &.end:dir(rtl) {
    &, banner > revealer > widget {
      box-shadow: none;
      border-right: 1px solid $border;
    }
  }

  &:dir(rtl), &.end:dir(ltr) {
    &, banner > revealer > widget {
      box-shadow: none;
      border-left: 1px solid $border;
    }
  }
}

.sidebar-pane .sidebar-pane {
  background-color: transparent;
  color: inherit;
}

.sidebar-pane {
  .top-bar,
  .sidebar,
  .toolbar,
  .navigation-sidebar,
  searchbar > revealer > box {
    background-color: transparent;
    box-shadow: none;
    border: none;
  }

  headerbar {
    border-top-right-radius: 0;

    &, &:backdrop {
      background-color: transparent;
      box-shadow: inset 0 1px highlight($titlebar);
    }
  }

  window.maximized & headerbar,
  window.tiled & headerbar {
    box-shadow: none;
  }

  @if $variant == 'light' and $topbar == 'dark' {
    entry { @extend %titlebar-entry; }

    button:not(.suggested-action):not(.destructive-action) {
      @extend %titlebar-button;
    }

    separator {
      background-color: $titlebar-divider;
    }
  
    .dim-label { color: $titlebar-text-disabled; }

    .navigation-sidebar {
      color: $titlebar-text-secondary;
    
      > row {
        color: $titlebar-text-secondary;
    
        &:hover, &:active,
        &:focus-visible:focus-within {
          color: $titlebar-text;
        }

        &:selected {
          color: $primary;
        }
    
        &:disabled { color: $titlebar-text-secondary-disabled; }
      }
    }

    list.content,
    list.boxed-list {
      background-color: $titlebar-fill;
      color: $titlebar-text;
      border-color: $titlebar-divider;

      > row {
        // Regular rows and expander header rows background
        &, &.expander row.header {
          color: $titlebar-text-secondary;
          border-color: $titlebar-divider;
        }

        &:hover, &:active,
        &:focus-visible:focus-within {
          color: $titlebar-text;
        }
      }
    }

    check, radio {
      color: $titlebar-text-secondary;

      &:hover, &:active { color: $titlebar-text; }

      &:disabled { color: $titlebar-text-secondary-disabled; }

      &:checked, &:indeterminate { color: $check_radio_primary; }

      &:checked:disabled, &:indeterminate:disabled { color: $titlebar-text-secondary-disabled; }
    }

    popover {
      color: $text;

      > contents {
        color: $text;

        separator {
          background-color: $divider;
        }

        .dim-label { color: $text-disabled; }

        entry {
          @extend %titlebar-entry-reset;
        }

        button:not(.suggested-action):not(.destructive-action) {
          @extend %titlebar-button-reset;

          &:hover {
            outline: none;
          }
        }
      }
    }
  
    scrollbar {
      background-color: transparent;
      border: none;
  
      > range > trough {
        > slider {
          background-color: $titlebar-text-secondary-disabled;
    
          &:hover { background-color: $titlebar-text-disabled; }
      
          &:active { background-color: $titlebar-text-secondary; }
      
          &:disabled { background-color: $titlebar-text-secondary-disabled; }
        }
      }
  
      &.overlay-indicator {
        &:not(.dragging):not(.hovering) {
          > range > trough {
            > slider {
              border: none;
            }
          }
  
          button {
            border: none;
            background-color: $titlebar-text-disabled;
  
            &:disabled { background-color: $titlebar-text-secondary-disabled; }
          }
        }
  
        &.dragging,
        &.hovering { background-color: transparent; }
      }
    }
  }
}

.content-pane {
  &, &:backdrop {
    background-color: $background;
  }

  headerbar {
    color: $text;
    border-top-left-radius: 0;

    &, &:backdrop {
      background-color: transparent;
      box-shadow: inset 0 1px highlight($background);
    }

    .subtitle,
    .dim-label {
      color: $text-secondary;
  
      &:backdrop { color: $text-disabled; }
    }

    button:not(.suggested-action):not(.destructive-action) {
      @extend %titlebar-button-reset;
    }

    entry {
      @extend %entry-basic;
    }

    viewswitcher {
      &.wide {
        background-color: $fill;
      }
    }
  }

  window.maximized & headerbar,
  window.tiled & headerbar {
    box-shadow: none;
  }
}

.sidebar-pane,
.content-pane {
  toolbarview.undershoot-top:not(.view) scrolledwindow {
    @include undershoot(top, $style: solid);
  }

  toolbarview.undershoot-bottom:not(.view) scrolledwindow {
    @include undershoot(bottom, $style: solid);
  }

  scrolledwindow {
    &.undershoot-top {
      @include undershoot(top, $style: solid);
    }

    &.undershoot-bottom {
      @include undershoot(bottom, $style: solid);
    }

    &.undershoot-start {
      &:dir(ltr) { @include undershoot(left, $style: solid); }
      &:dir(rtl) { @include undershoot(right, $style: solid); }
    }

    &.undershoot-end {
      &:dir(ltr) { @include undershoot(right, $style: solid); }
      &:dir(rtl) { @include undershoot(left, $style: solid); }
    }
  }
}


//
// AdwToolbarView
//

toolbarview {
  > .top-bar,
  > .bottom-bar {
    searchbar {
      > revealer > box {
        background-color: transparent;
        box-shadow: none;
      }
    }

    actionbar {
      > revealer > box {
        background-color: transparent;
        border: none;
        box-shadow: none;
      }
    }

    .toolbar {
      background-color: transparent;
      padding: 0 0 0 6px;
      border-spacing: 0;
    }

    .collapse-spacing {
      padding-top: 0;
      padding-bottom: 0;

      headerbar {
        min-height: $large-size;

        > windowhandle > box {
          padding-top: $space-size;
          padding-bottom: $space-size;
        }

        &.default-decoration {
          min-height: $small-size;

          > windowhandle > box {
            padding-top: $space-size;
            padding-bottom: $space-size;
          }
        }
      }

      searchbar,
      actionbar {
        > revealer > box {
          padding-top: $space-size;
          padding-bottom: $space-size;
        }
      }

      .toolbar  {
        padding-top: $space-size;
        padding-bottom: $space-size;
      }

      tabbar {
        padding-top: 0;
        padding-bottom: 0;
      }
    }

    &.raised {
      background-color: transparent;
      color: $titlebar-text;

      &:backdrop {
        background-color: transparent;
      }
    }

    &:backdrop > windowhandle {
      filter: none;
    }
  }

  .top-bar {
    box-shadow: none;
    background-color: $titlebar;
  
    &:backdrop {
      background-color: $titlebar-backdrop;
    }
  
    .info &,
    .about & {
      &, &:backdrop {
        background-color: transparent;
      }
    }

    tabview &, tabview &:backdrop {
      background-color: $base;
    }

    .collapse-spacing {
      padding: 0;
    }

    windowhandle {
      filter: none;
    }
  }

  > .bottom-bar {
    padding: 0;
    border-spacing: 0;
    box-shadow: inset 0 1px $border;
    background-color: $base-alt;
    color: $text;

    &:backdrop {
      background-color: $background;
      color: $text-disabled;
    }

    actionbar > revealer > box {
      background-color: transparent;
      color: inherit;
      box-shadow: none;
      padding-top: $space-size;

      &:backdrop {
        background-color: transparent;
        transition: none;

        > * {
          filter: none;
          transition: none;
        }
      }
    }
  }

  > .top-bar.raised {
    box-shadow: none;

    &.border {
      box-shadow: none;
    }
  }

  > .bottom-bar.raised {
    box-shadow: none;

    &.border {
      box-shadow: none;
    }
  }
}

.sidebar-pane,
.content-pane {
  .top-bar,
  .bottom-bar,
  .top-bar:backdrop,
  .bottom-bar:backdrop {
    background-color: transparent;
    box-shadow: none;
  }
}

//
// Floating Sheet
//

floating-sheet {
  > dimming {
    background-color: rgba(black, 0.25);
  }

  > sheet.background {
    box-shadow: $shadow-z16;
    border-radius: $window-radius;
    outline: none;
  }
}

// ThemeSelector
themeselector, // Gnome text editor
panelthemeselector { // Gnome builder
  margin: $space-size * 1.5;

  checkbutton {
    padding: 0;
    min-height: 44px;
    min-width: 44px;
    padding: 1px;
    background-clip: content-box;
    border-radius: $circular-radius;
    box-shadow: inset 0 0 0 1px $border;

    &.follow:checked,
    &.light:checked,
    &.dark:checked {
      box-shadow: inset 0 0 0 2px $primary;
    }

    &.follow {
      background-image: linear-gradient(to bottom right, #ffffff 50%, #202020 50%);
    }

    &.light {
      background-color: #ffffff;
    }

    &.dark {
      background-color: #202020;
    }

    &.theme-selector radio {
      -gtk-icon-source: none;
      border: none;
      background: none;
      box-shadow: none;
      min-height: 20px;
      min-width: 20px;
      padding: 0;
      margin: 0;

      &:hover, &:active, &:checked {
        background-color: transparent;
        background-image: none;
      }

      &:checked {
        -gtk-icon-size: 20px;
        -gtk-icon-source: -gtk-scaled(-gtk-recolor(url("assets/scalable/select-symbolic.svg")), -gtk-recolor(url("assets/scalable/select-symbolic@2.svg")));
        color: on($primary);
        background-color: $primary;

        &, &:hover, &:active {
          box-shadow: 0 2px 3px -1px rgba(black, 0.08), 0 1px 2px 0 rgba(black, 0.1);
        }
      }
    }
  }
}

themeswitcher { // Gnome console
  padding: $space-size;

  .check {
    min-height: 20px;
    min-width: 20px;
    background: none;
    padding: 0;
    margin: 0;
    border-radius: $circular-radius;
    color: on($primary);
    background-color: $primary;

    &, &:hover, &:active {
      box-shadow: 0 2px 3px -1px rgba(black, 0.08), 0 1px 2px 0 rgba(black, 0.1);
    }
  }

  checkbutton {
    padding: 0;
    min-height: 44px;
    min-width: 44px;
    padding: 1px;
    background-clip: content-box;
    border-radius: $circular-radius;
    box-shadow: inset 0 0 0 1px $border;

    &:checked {
      box-shadow: inset 0 0 0 2px $primary;
    }

    radio {
      &, &:hover, &:active, &:checked, &:checked:hover, &:checked:active {
        background-color: transparent;
        border: none;
        background: none;
        box-shadow: none;
        color: transparent;
        -gtk-icon-source: none;
        -gtk-icon-size: 0;
      }
    }

    &.system {
      background: linear-gradient(-45deg, #1e1e1e 50%, white 50%);
    }

    &.light {
      color: gtkalpha(black, .8);
      background-color: white;
    }

    &.dark {
      color: white;
      background-color: #1e1e1e;
    }
  }
}
